package com.xunker.oss.controller;


import com.xunker.appointment.result.Result;
import com.xunker.oss.service.FileUploaderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("api/oss")
public class FileUploaderController {
    @Autowired
    private FileUploaderService fileUploaderService;
    /**
     * 上传到Oss
     * @param file
     * @return
     */
    @PostMapping("uploader")
    public Result uploader(MultipartFile file){
        String url=fileUploaderService.uploader(file);
        return Result.ok(url);
    }
}
